package com.mashen.client.model;

public class AccessToken {
	/**
	 * 接口调用凭证
	 */
	private String access_token;
	/**
	 * token超时时间
	 */
	private int expires_in;//秒
	/**
	 * 创建时间
	 */
	private long createtime=System.currentTimeMillis();
	
	/**
	 * 判断是否已经超时
	 * @return true:已经超时,false:未超时
	 */
	public boolean isExpires(){
		System.out.println("expires_in:"+expires_in);
		System.out.println("实际时间:"+(System.currentTimeMillis()-createtime)/1000);
		System.out.println("微信服务器超时时间:"+(expires_in-60*15));
		return (System.currentTimeMillis()-createtime)/1000>=expires_in-60*15;//容错时间15分钟
	}
	
	public String getAccess_token() {
		return access_token;
	}
	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}
	public int getExpires_in() {
		return expires_in;
	}
	public void setExpires_in(int expires_in) {
		this.expires_in = expires_in;
	}
}
